package datasv.login_datasv;

import data.datafactory.DatabaseOperator;
import resultmessage.LoginRM;

public class DeleteUser {
	public static void main(String[] args) {
		System.out.println(new DeleteUser().deleteUser("001131011"));
	}
	public LoginRM deleteUser(String id){
		return deleteInSql(id);
	}
	private LoginRM deleteInSql(String id ){
		DatabaseOperator op=new DatabaseOperator("university_database");
		String listName="userpo_list";
		if(!op.ifIDExist(listName, id)){
			return LoginRM.NO_EXIST_ID; 
		}
		if(op.deleteOneRow(id, listName)){
			return LoginRM.SUCCESS;
		}
		return LoginRM.NO_EXIST_ID;
	}
}
